package com.example.springioclearning;

import com.example.springioclearning.model.MessageService;
import com.example.springioclearning.model.impl.MessageServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        // 这里就是 使用配置文件来配置bean到容器当中
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:application.xml");

        System.out.println("context 启动成功");

        // 从容器中获取bean  而不是new出来
        MessageService messageService = context.getBean(MessageService.class);

        System.out.println(messageService.getMessage());

    }
}
